package cn.wangsy.zhidao.p20170408.triangle;

public class TriangleTest {

	public static void main(String[] args) throws IiegalArgumentException,InvailEdgesException{

		if (args.length < 3) {
			throw new ArrayIndexOutOfBoundsException();
		}

		if(!isNumeric(args[0]) || !isNumeric(args[1]) || !isNumeric(args[2])){
			throw new NumberFormatException();
		}
		
		int a = Integer.parseInt(args[0]);
		int b = Integer.parseInt(args[1]);
		int c = Integer.parseInt(args[2]);
		
		if(a < 0 || b < 0 || c < 0){
			throw new IiegalArgumentException();
		}
		
		if(!(a+b>c)&&(a+c>b)&&(b+c)>a){
			throw new InvailEdgesException();
		}
		
		System.out.println("end");
		
	}

	public static boolean isNumeric(String str) {
		for (int i = 0; i < str.length(); i++) {
			System.out.println(str.charAt(i));
			if (!Character.isDigit(str.charAt(i))) {
				return false;
			}
		}
		return true;
	}
	
	
}
class IiegalArgumentException extends Exception{}
class InvailEdgesException extends Exception{}
